<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Add contract</title>
    </h:head>
    <h:body>
        <ui:composition template="/pages/common/layout.xhtml">
            <ui:define name="content">
                <h:form>
                        <h:outputLabel for="name" value="Information of client"></h:outputLabel>
                    <h:panelGrid columns="2">
                        <h:outputLabel for="name" value="Name"></h:outputLabel>
                        <h:inputText id="name" value="#{apartmentContractBean.apartmentContract.client.name}" required="true"></h:inputText>
                        <h:outputLabel for="phone_number" value="Phone number"></h:outputLabel>
                        <h:inputText id="phone_number" value="#{apartmentContractBean.apartmentContract.client.phoneNumber}" required="true"></h:inputText>
                        <h:outputLabel for="address" value="Address"></h:outputLabel>
                        <h:inputText id="address" value="#{apartmentContractBean.apartmentContract.client.address}" required="true"></h:inputText>
                        <h:outputLabel for="email" value="Email"></h:outputLabel>
                        <h:inputText id="email" value="#{apartmentContractBean.apartmentContract.client.email}" required="true"></h:inputText>
                    </h:panelGrid>
                        <h:outputLabel for="name" value="Information of apartment"></h:outputLabel>
                    <h:panelGrid columns="2">
                        <h:outputLabel for="number_of_person" value="Number_of_person"></h:outputLabel>
                        <h:inputText id="number_of_person" value="#{apartmentContractBean.apartmentContract.apartment.numberOfPerson}" required="true">
                        </h:inputText>

                        <h:outputLabel for="area" value="Area"></h:outputLabel>
                        <h:inputText id="area" value="#{apartmentContractBean.apartmentContract.apartment.area}" required="true">
                        </h:inputText>

                        <h:outputLabel for="direction" value="Direction"></h:outputLabel>
                        <h:inputText id="direction" value="#{apartmentContractBean.apartmentContract.client.name}" required="true">
                        </h:inputText>

                        <h:outputLabel for="floor" value="Floor"></h:outputLabel>
                        <h:inputText id="floor" value="#{apartmentBean.apartment.floor}" required="true">
                        </h:inputText>

                        <h:outputLabel for="building" value="Building"></h:outputLabel>
                        <h:inputText id="building" value="#{apartmentBean.apartment.building}" required="true">
                        </h:inputText>

                        <h:commandButton value="Add Apartment" action="#{apartmentBean.addApartment()}">
                        </h:commandButton>
                    </h:panelGrid>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

